# Maintainer: Brett Cornwall <ainola@archlinux.org>
# Contributor: Antoine Damhet

pkgname=kanshi
pkgver=1.4.0
pkgrel=1
pkgdesc='Dynamic output configuration for Wayland WMs'
arch=(loong64 x86_64)
url="https://wayland.emersion.fr/kanshi/"
license=('MIT')
makedepends=('meson' 'scdoc')
depends=('wayland' 'libvarlink')
source=(
    "https://git.sr.ht/~emersion/kanshi/refs/download/v$pkgver/kanshi-$pkgver.tar.gz"
    "https://git.sr.ht/~emersion/kanshi/refs/download/v$pkgver/kanshi-$pkgver.tar.gz.sig"
)
sha256sums=('9b88dfe03cf786df4351103f76565120228f6680e4823468f7d05e1b1cbc2280'
            'SKIP')
validpgpkeys=('34FF9526CFEF0E97A340E2E40FDE7BE0E88F5E48')  # Simon Ser (emersion)

build() {
    meson --prefix=/usr \
        --buildtype=plain \
        -Dman-pages=enabled \
        -Dipc=enabled \
        "${pkgname}-${pkgver}" build
    ninja -C build
}

package() {
    DESTDIR="${pkgdir}" ninja -C build install
    cd "$pkgname-$pkgver"
    install -Dm0644 "LICENSE" -t "${pkgdir}/usr/share/licenses/$pkgname/"
    install -Dm0644 "README.md" -t "$pkgdir/usr/share/doc/$pkgname/"
}
